package cn.ocean.test;

import cn.ocean.utils.JedisUtils;
import com.sun.javafx.sg.prism.NGCamera;
import org.junit.Test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisTset {


    @Test
    public void test() throws Exception{
        // 创建连接
        Jedis jedis = new Jedis("127.0.0.1",6379,3000);
        jedis.auth("123456");
        jedis.set("name","赵洋");
        String name = jedis.get("name");
        System.out.println(name);
    }

    @Test
    public void test2() throws Exception{
        Jedis jedis = JedisUtils.INSTANCE.getJedis();
        jedis.set("name","赵洋");
        String name = jedis.get("name");
        System.out.println(name);
        jedis.close();

    }

}
